Quantification of fibrosis extend and airspace availability in lung: A semi-automatic ImageJ/Fiji toolbox

The evaluation of the structural integrity of mechanically dynamic organs such as lungs is critical for the diagnosis of numerous pathologies and the development of therapies. This task is classically performed by histology experts in a qualitative or semi-quantitative manner. Automatic digital image processing methods appeared in the last decades, and although immensely powerful, tools are highly specialized and lack the versatility required in various experimental designs. Here, a set of scripts for the image processing software ImageJ/Fiji to easily quantify fibrosis extend and alveolar airspace availability in Sirius Red or Masson’s trichrome stained samples is presented. The toolbox consists in thirteen modules: sample detection, particles filtration (automatic and manual), border definition, air ducts identification, air ducts walls definition, parenchyma extraction, MT-staining specific pre-processing, fibrosis detection, fibrosis particles filtration, airspace detection, and visualizations (tissue only or tissue and airspace). While the process is largely automated, critical parameters are accessible to the user for increased adaptability. The modularity of the protocol allows for its adjustment to alternative experimental settings. Fibrosis and airspace can be combined as an evaluation of the structural integrity of the organ. All settings and intermediate states are saved to ensure reproducibility. These new analysis scripts allow for a rapid quantification of fibrosis and airspace in a large variety of experimental settings.


List of materials needed:
ImageJ session accepting the installation of macros (used here: Fiji 2.3.0 with ImageJ 1.53q, and Fiji 2.14.0 with ImageJ 1.54f) whole slide images of lung stained with SR or MT Macros available at: Lung-brosis-and-airspace-quanti cation (GitHub) Benchmark dataset available at Lung-brosis-and-airspace-quanti cation ( gshare)

BEFORE START INSTRUCTIONS
Files with the "ijm" extension must be copied to the plugins folder of ImageJ/Fiji (e.g., …/Fiji/plugins/Fibrosis).
ImageJ/Fiji manages images directly in the RAM of the computer.The maximum RAM ImageJ/Fiji is allowed to use is set in a dedicated menu (Edit > Options > Memory & Threads…).
Alternatively, ImageJ/Fiji can import large images as "Virtual Stack" to avoid loading all data in the RAM.A dedicated menu is available to use this format (File > Import > TIFF Virtual Stack…).Note that displaying the image will be slower.

1.1
Open the image to be analyzed (File > Open…).

1.4
De ne the lower (close to black: strongly stained tissue) and upper (close to white: lightly stained tissue) thresholds (reset to automatically de ned values available).Selected objects are highlighted in yellow on the overlay.
To nish, check the "Con rm settings" box and click the "OK" button.

1.5
Save output les in the desired folder (check the "Save" box and click "OK").

2.2
Open the mask of the sample obtained at step 1.5 (File > Open…).

2.4
De ne the minimal and maximal size cutoffs (reset to default values available).Selected objects are highlighted in orange on the overlay.
To nish, check the "Con rm settings" box and click the "OK" button.

2.5
Save output les in the desired folder (check the "Save" box and click "OK").

2.6
Manual cleaning

2.7
Open the mask of the sample obtained at step 2.5 (File > Open…).

2.9
Using a selection tool (e.g., Rectangle), select undesirable objects in the background and delete them (<delete>).Click the "OK" button on the dialog window.Note: it is not necessary to clean particles in air ducts as most will be deleted at the air ducts identi cation step.

2.10
Selected objects are highlighted in magenta on the overlay.
To nish, check the "Con rm cleaning" box and click the "OK" button.

2.11
Save output les in the desired folder (check the "Save" box and click "OK").

3.1
Open the mask of the sample obtained at step 2.11 (File > Open…).

Border definition
Air ducts and air ducts walls de nition

4.1
Air ducts identi cation Note: as it is not easy to identify air ducts on a binary mask, it is advised to refer to the original image.

4.2
Open the mask of the sample obtained at step 2.11 (File > Open…).

4.4
Check the "Add new air duct" box and click the "OK" button to enter the selection mode.

4.5
Using a selection tool (e.g., Wand (tracing) tool), select an air duct.It is advised to add air ducts one by one.To validate a selection, click the "OK" button on the dialog window.Selected objects are highlighted in cyan on the overlay.Note: check the "Delete last air duct" box and click the "OK" button to remove the last air duct from the selection.
To nish, check the "Con rm selection" box and click the "OK" button.

Parenchyma extraction
Note: it is recommended to use Fiji as this module has a dependency to the plugin Colour Deconvolution.

6.1
Open the image of the parenchyma obtained at step 5.4 (File > Open…).

6.3
Save output les in the desired folder (check the "Save" box and click "OK").

7
Fibrosis detection Note: the separation of color channels is different between SR and MT, which leads to different threshold settings.

7.1
Open the image of the parenchyma (SR; step 5.4) or of the connective tissue in the parenchyma (MT; step 6.3) (File > Open…).

Fibrosis detection
Bio-Formats supports BigTiff (File > Import > Bio-Formats) and can manage extremely large images.Recommendations on lung sample preparation can be found in: Hsia CC, Hyde DM, Ochs M, Weibel ER; ATS/ERS Joint Task Force on Quantitative Assessment of Lung Structure.An o cial research policy statement of the American Thoracic Society/European Respiratory Society: standards for quantitative assessment of lung structure.Am J Respir Crit Care Med.2010 Feb 15;181(4):394-418.doi: 10.1164/rccm.200809-1522ST.PMID: 20130146; PMCID: PMC5455840.Slides of different anatomical positions within the lungs should be analyzed to minimize sampling or orientation bias. 1 Sample detection Representative samples.1. Mouse lung slice stained with MT (baseline sample); 2. Mouse lung slice stained with MT (bleomycin-induced brosis sample); 3. Mouse lung slice stained with SR (baseline sample); 4. Mouse lung slice stained with SR (bleomycin-induced brosis sample).
Background cleaning.A. Interface of the "particle lter" automatic and manual tools.B. Cleaned binary masks of samples: 1. Mouse lung slice stained with MT (baseline sample); 2. Mouse lung slice stained with MT (bleomycin-induced brosis sample); 3. Mouse lung slice stained with SR (baseline sample); 4. Mouse lung slice stained with SR (bleomycin-induced brosis sample).
Fibrosis cleaningNote: SR and MT stain different structures, which leads to different lter settings.
Launch the script (Plugins > Fibrosis > Visualization tissue).9.2Open the required les (automatic prompt): sample image (original) parenchyma ROI set (from step 5.4) sample border ROI set (from step 3.5) air ducts walls ROI set (from step 4.11) air ducts ROI set (from step 4.6) brosis ROI set (from step 8.5) Tissue visualization